#ifndef __SERVICE_H__
#define __SERVICE_H__

#include <iostream>
#include <string>
#include <list>
#include <arpa/inet.h>
#include "EpollTool.h"
#include "SockTool.h"
#include "Log.h"

#define MAX_EVENT_NUMBER 100
#define SERVER_PORT 1125
#define SERVER_IP "127.0.0.1"

using std::list;
using std::string;
//������Ϣ�ṹ
struct Msg
{
    int type;
    int fromID;
    int toID;
    char content[1024];
};

class Service{
public:
    Service();
    ~Service();
    // ��ʼ��������������
    void init();
    //�رշ���
    void stop();
    //��������
    void start();

private:
    string TAG="Service";

    //����������Ϣ
    struct sockaddr_in serverAddr;
    //�����׽���
    int listenfd;
    //epoll�׽���
    int epollfd;
    //�ͻ����б�
    list<int> clientList;
    struct epoll_event events[MAX_EVENT_NUMBER] = {0};
};


#endif

